//
//  WDCalendarViewCell.m
//  Demos
//
//  Created by iMac on 2018/3/5.
//  Copyright © 2018年 iMac. All rights reserved.
//

#import "WDCalendarViewCell.h"
#import "WDCalendarDayModel.h"



@interface WDCalendarViewCell()

@property (nonatomic, strong) UILabel *dayLable;

@end

@implementation WDCalendarViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupInit];
    }
    return self;
}

- (void)setModel:(WDCalendarDayModel *)model {
    
    _model = model;
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    formatter.dateFormat = @"dd";
    NSString *day = [formatter stringFromDate:model.date];
    self.dayLable.text = day;
}

- (void)setupInit {
    self.dayLable = ({
        UILabel *lable = [[UILabel alloc] init];
        lable.font = [UIFont systemFontOfSize:18];
        lable.textColor = [UIColor darkTextColor];
        lable;
    });
    [self.contentView addSubview: self.dayLable];
    [self.dayLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self);
    }];


    
}
@end
